import request from '@/utils/request';

export default {
    //加载子环节和服务树
    loadtree(actionid, lvl) {
        console.log(`子环节和服务树：${actionid} ${lvl}`);
        return request.get('/esbview/v-action/loadtree?actionid=' + actionid + '&lvl=' + lvl)
    },

    //加载子环节信息
    loadsubaction(id) {
        return request.get('/esbview/v-subaction/info/' + id)
    },

    //新增子环节
    saveAction(data) {
        return request.post('/esbview/v-action/save', data)
    },

    //删除子环节
    delAction(id) {
        return request.post('/esbview/v-action/delete', id)
    },

    //删除子环节关联服务
    delSubAction(id) {
        return request.post('/esbview/v-subaction/delete', id)
    },

    //新增子环节的关联服务
    saveSubaction(data) {
        return request.post('/esbview/v-subaction/save', data)
    },

    //子环节拖拽之后，保存新的列表
    saveActionList(data) {
        return request.post('/esbview/v-action/saveList', data)
    },
    //子环节的关联服务拖拽之后，保存新的列表
    saveSubActionList(data) {
        return request.post('/esbview/v-subaction/saveList', data)
    },

    //查询标准服务列表，供下拉列表用
    queryInboundMain() {
        return request.get('/esbview/esb-inbound-main/listall')
    },

    //查询标准服务列表，供下拉列表用
    queryInboundMainLike(key) {
        return request.get('/esbview/esb-inbound-main/list/' + key)
    },
}
